package com.yixing.tech.wcs.constant;

public enum AgvRasterTaskEnum {
    P1("S1_01Q", "S1_01", "1"), P2("S1_02Q", "S1_02", "2"),
    P3("S1_03Q", "S1_03", "3"), P4("S1_04Q", "S1_04", "4");

    private final String outerPos;
    private final String station;

    private final String rasterNo;

    AgvRasterTaskEnum(String outerPos, String station, String rasterNo) {
        this.outerPos = outerPos;
        this.station = station;
        this.rasterNo = rasterNo;
    }

    public String getOuterPos() {
        return outerPos;
    }

    public String getStation() {
        return station;
    }

    public String getRasterNo() {
        return rasterNo;
    }

    public static AgvRasterTaskEnum getByStation(String station) {
        for(AgvRasterTaskEnum e: AgvRasterTaskEnum.values()){
            if(e.getStation().equals(station))
                return e;
        }
        return null;
    }

    public static AgvRasterTaskEnum getByOuterPos(String outerPos) {
        for(AgvRasterTaskEnum e: AgvRasterTaskEnum.values()){
            if(e.getOuterPos().equals(outerPos))
                return e;
        }
        return null;
    }

    @Override
    public String toString() {
        return "AgvRasterTaskEnum{" +
                "outerPos='" + outerPos + '\'' +
                ", station='" + station + '\'' +
                ", rasterNo='" + rasterNo + '\'' +
                '}';
    }
}
